public class FizzBuzz {

    public String fizzBuzz(int value) {
        String output = "";
        for (int count = 1; count <= value; count++) {
            if (isDivisibleByThreeAndFive(count)) {
                output += "FizzBuzz";
            } else if (isDivisibleByThree(count)) {
                output += "Fizz";
            } else if (isDivisibleByFive(count)) {
                output += "Buzz";
            } else {
                output += String.valueOf(count);
            }
            output +="\n";
        }
        return  output;
    }

    private boolean isDivisibleByThree(int number) {
        return number % 3 == 0;
    }

    private boolean isDivisibleByFive(int number) {
        return number % 5 == 0;
    }

    private boolean isDivisibleByThreeAndFive(int number) {
        return (number % 3 == 0) && (number % 5 == 0);
    }
}
